<template>
  <div id="app">
    <el-config-provider :locale="zhCn">
      <router-view /><!--父级页面路由视图-->
    </el-config-provider>
  </div>
</template>

<script>
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import ResizeHandle from "@/layout/mixin/ResizeHandler";
// 解决ERROR ResizeObserver loop completed with undelivered notifications.

//问题的
const debounce = (fn, delay) => {
  let timer = null;
  return function () {
    let context = this;
    let args = arguments;
    clearTimeout(timer);
    timer = setTimeout(function () {
      fn.apply(context, args);
    }, delay);
  }
}
// 解决ERROR ResizeObserver loop completed with undelivered notifications.

//问题的
const _ResizeObserver = window.ResizeObserver;
window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
  constructor(callback) {
    callback = debounce(callback, 16);
    super(callback);
  }
}
export default {
  name: "App",
  data(){
    return{
      zhCn:zhCn
    }
  },
  created() {
  },
  mixins: [ResizeHandle]
};
</script>

<style></style>
